<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03选择、插入、删除元素</title>
    <script src="./node_modules/d3/dist/d3.min.js"></script>
</head>
<body>
<!--<p>Apple</p>-->
<!--<p>Pear</p>-->
<!--<p>Banana</p>-->
</body>
</html>
<script>
    const body = d3.select('body')
    body.append('h1')
        .text('Hello World')
        .attr('id', 'P')
    body.insert('h2', '#P')
        .text('I am H2')
    body.select('#P').remove()
</script>
